﻿using System;
using System.Web;

namespace Shumisen.Web.Form
{
	public static class HttpRequestExtensions
	{
		public static bool IsGetMethod(this HttpRequest request)
		{
			return IsMethod(request, "GET");
		}

		public static bool IsPostMethod(this HttpRequest request)
		{
			return IsMethod(request, "POST");
		}

		private static bool IsMethod(HttpRequest request, string httpMethod)
		{
			return request != null && string.Equals(request.HttpMethod, httpMethod, StringComparison.Ordinal);
		}

	}
}